<html>
<head>
<title>Parsing Command Line Arguments</title>
</head>
<body>
<table width=100%>
<tr>
<td align=left>
<a href="conventions.html"><img src=../../images/PreviousArrow.gif width=26 height=26 align=bottom border=0 alt="Previous | "></a><a
href="../threads/index.html"><img src=../../images/NextArrow.gif width=26 height=26 align=bottom border=0 alt="Next | "></a><a
href="../../index.html"><img src=../../images/WayUpArrow.gif width=26 height=26 align=bottom border=0 alt="Trail Map | "></a><a
href="../index.html"><img src=../../images/javaHeader.gif width=26 height=26 align=bottom border=0 alt="Writing Java Programs | "></a>
<td>
<td align=right>
<a href="index.html"><strong><em>Command Line Arguments</em></strong></a>
</td>
</tr>
</table>
<p>
<hr size=4>

<h2>
    Parsing Command Line Arguments
</h2>
<p>
<blockquote>

This <a href=example/ParseCmdLine.java>program</a>
provides you with a basis from which
you can build your own command line parser.
It accepts one command line argument of each type:
a word argument, an argument that requires an argument, and two flags.
In addition, this program requires a filename.
Here's the usage statement for this program:
<pre>
usage: ParseCmdLine [-verbose] [-xn] [-output <i>afile</i>] filename
</pre>
The arguments within square brackets are optional;
the <i>filename</i> argument is required.
<p>
<h4>See Also</h4>
<blockquote>
The example program relies heavily on the String and System classes. For more information
about these two classes follow the links below.
<p>
<a href="../strings/index.html"><img src=../../images/javaIcon.gif height=20 width=20 border=0></a>
<a href="../strings/index.html"><em>The String and StringBuffer Classes</em></a><br>
<a href="../../tools/system/index.html"><img src="../../images/toolIcon.gif" height=20 width=20 border=0></a>
<a href="../../tools/system/index.html"><em>Using System Resources</em></a><br>
<p>
<a href="http://java.sun.com/JDK-beta/api/java.lang.String.html"><img src=../../images/apiIcon.gif height=20 width=20 border=0></a>
<a href="http://java.sun.com/JDK-beta/api/java.lang.String.html">java.lang.String</a><br>
<a href="http://java.sun.com/JDK-beta/api/java.lang.System.html"><img src=../../images/apiIcon.gif height=20 width=20 border=0></a>
<a href="http://java.sun.com/JDK-beta/api/java.lang.System.html">java.lang.System</a><br>
</blockquote>

</blockquote>
<p>
<hr size=4>
<p>
<table width=100%>
<tr>
<td align=left>
<a href="conventions.html"><img src=../../images/PreviousArrow.gif width=26 height=26 align=top border=0 alt="Previous | "></a><a
href="../threads/index.html"><img src=../../images/NextArrow.gif width=26 height=26 align=top border=0 alt="Next | "></a><a
href="../../index.html"><img src=../../images/WayUpArrow.gif width=26 height=26 align=top border=0 alt="Trail Map | "></a><a
href="../index.html"><img src=../../images/javaHeader.gif width=26 height=26 align=top border=0 alt="Writing Java Programs | "></a>
<td>
<td align=right>
<a href="index.html"><strong><em>Command Line Arguments</em></strong></a>
</td>
</tr>
</table>
</body>
</html>
